import React from 'react'
import {sytRequest} from "@/request";
//GET /admin/hosp/hospitalSet/{page}/{limit}
// 获取分页列表
export const getHospitalSet = (page: number, limit: number, params:any ={}) =>{//传一个query参数，包含hosname和hoscode
    return sytRequest.get(`/admin/hosp/hospitalSet/${page}/${limit}`,{params})
}
// GET /admin/hosp/hospitalSet/lock/{id}/{status}
// 锁定
export const getHospitalSetLockId = (id: number, status: number) => {
    status = status===0 ? 1 : 0;
    return sytRequest.get(`/admin/hosp/hospitalSet/lock/${id}/${status}`)
}
// 新增医院设置
// POST /admin/hosp/hospitalSet/save
// 新增医院设置
export const postHospitalSet = (body:any)=>{
    return sytRequest.post('/admin/hosp/hospitalSet/save', body);
}
// PUT /admin/hosp/hospitalSet/update

// 修改医院设置
export const putHospitalSet = (body:any) => {
    return sytRequest.put('/admin/hosp/hospitalSet/update', body)
}
// DELETE /admin/hosp/hospitalSet/remove/{id}
// 删除医院设置
export const delHospitalSetById = (id:number) => {
    return sytRequest.delete(`/admin/hosp/hospitalSet/remove/${id}`)
}
// DELETE /admin/hosp/hospitalSet/batchRemove
// 根据id列表删除医院设置
export const delBatchRemove = (data:React.Key[]) => {
    return sytRequest.delete(`/admin/hosp/hospitalSet/batchRemove`, {
        data
    })
}

//医院管理
//GET /admin/hosp/hospital/{page}/{limit}
// 获取分页列表
export const getHospitalList = (page:number, limit: number, params:any ={}) => {
    return sytRequest.get(`/admin/hosp/hospital/${page}/${limit}`, {params})
}
// GET /admin/hosp/hospital/show/{id}
// 获取医院详情
export const getHospitalListById = (id: string) => {
    return sytRequest.get(`/admin/hosp/hospital/show/${id}`)
}
// GET /admin/hosp/hospital/updateStatus/{id}/{status}
// 更新上线状态
export const updateHospitalListById = (id: string, status: number) => {
    return sytRequest.get(`/admin/hosp/hospital/updateStatus/${id}/${status}`)
}


//获取科室列表
// GET /admin/hosp/department/{hoscode}
// 获取分页列表
export const getDepartmentByHoscode = function(hoscode:string){
    return sytRequest.get(`/admin/hosp/department/${hoscode}`)
}